package ooday02.animal;

public class Test {
    public static void main(String[] args) {
        Chick a=new Chick(1,"s","3");

        Dog[] dogs = new Dog[3];
        dogs[0] = new Dog(2, "小白", "白");
        dogs[1] = new Dog(4, "哈撒起", "黄的");
        dogs[2] = new Dog(5, "二狗子", "金光");
        dogs[1].name = "内瑟斯";
        for (int i = 0; i < dogs.length; i++) {
            System.out.println(dogs[i].name);
            dogs[i].eat();
        }
        dogs[2].drink();
        dogs[0].swim();

        Fish[] fishs=new Fish[4];
        System.out.println(fishs);
        fishs=null;
        System.out.println(fishs);
        fishs[0]=new Fish(2,"xiaoyuer","红色");
        fishs[1]=new Fish(3,"小傻瓜","蓝色");
        fishs[1].name="魔法鲸鱼";

        //fishs[1]=null;
        System.out.println(fishs[1]);
        for(int i=0;i<fishs.length;i++){
            System.out.println(fishs[i].name);
        }
        Chick[] chicks=new Chick[10];
        chicks[0]=new Chick(2,"斗鸡","黄黄的");
        for (int i=0;i<chicks.length;i++){
            chicks[i]=new Chick(2,"斗鸡","黄黄的");
            chicks[i].drink();
        }

    }
}
